<!--@if($grant->manager)-->

<!--%import("../../tpl/js/write_form.js")-->
<!--%import("../../tpl/js/option.js")-->

<script type="text/javascript">
	var title_org = "{htmlspecialchars($oDocument->getTitleText())}";
	var lang_title_name = "{$lang->product_name}";
</script>

<!--#include("_header.html")-->

<div class="lineClear"></div>

<div id="moduleProduct">

<!-- 게시물 작성 폼 -->
<form action="./" method="post" onsubmit="return procFilter(this, insert)" id="fo_write">
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="content" value="{$oDocument->getContentText()}" />
<input type="hidden" name="product_srl" value="{$product_srl}" />
<input type="hidden" name="document_srl" value="{$document_srl}" />

<div class="productWrite">

	<div class="box">
		<div class="inputContainer">
			<input type="text" name="title" style="width:95%;" class="inputTypeText" value="{$oDocument->get('title')}" />
		</div>
    </div>

	<div class="box">
		<div class="inputContainer">
			<!--@if($module_info->use_category=="Y")-->
			{$lang->product_category} : 
			<select name="category_srl" class="category">
				<option value="">{$lang->category}</option>
				<!--@foreach($category_list as $val)-->
				<option <!--@if(!$val->grant)-->disabled="disabled"<!--@endif--> value="{$val->category_srl}" <!--@if($val->grant&&$val->selected||$val->category_srl==$oDocument->get('category_srl'))-->selected="selected"<!--@endif-->>
					{str_repeat("&nbsp;&nbsp;",$val->depth)} {$val->title} ({$val->document_count})
				</option>
				<!--@endforeach-->
			</select>
			/
			<!--@endif-->
			<input type="checkbox" name="allow_comment" value="Y" <!--@if($oDocument->allowComment())-->checked="checked"<!--@end--> id="allow_comment" /><label for="allow_comment">{$lang->allow_comment}</label>
		</div>
    </div>
	
	<div class="lineClear"></div>

	<div class="box">상품이미지 <span style="font-weight:normal;color:#666666; font-size:11px;">(에디터 업로드와는 별도로 작동합니다.)</span></div>
	<div class="box">{$this->getThumbManager($product->product_srl,$product->master_image)}</div>

	<div class="lineClear"></div>

	<div class="box">기본정보</div>
	<div class="box">
		<div style="overflow:hidden;">
		<table cellspacing="0" width="100%" summary="" class="productVarsList" id="productVarsList">
		<col width="100" />
		<col />
		<tr>
			<th scope="row">{$lang->product_code}</th>
			<td align="left">
				<input type="text" name="code" id="code" value="{$product->code}" class="inputTypeText w300"/>
			</td>
		</tr>
		<tr>
			<th scope="row">{$lang->product_maker}</th>
			<td align="left">
				<input type="text" name="maker" id="maker" value="{$product->maker}" class="inputTypeText w200"/>
			</td>
		</tr>
		<tr>
			<th scope="row">{$lang->product_brand}</th>
			<td align="left">
				<input type="text" name="brand" id="brand" value="{$product->brand}" class="inputTypeText w200"/>
			</td>
		</tr>
		<tr>
			<th scope="row">{$lang->product_origin}</th>
			<td align="left">
				<input type="text" name="origin" id="origin" value="{$product->origin}" class="inputTypeText w200"/>
			</td>
		</tr>
		<tr>
			<th scope="row">{$lang->product_origin_price}</th>
			<td align="left">
				<input type="text" name="origin_price" id="origin_price" value="{$product->price_base}" class="inputTypeText w200"/> {$lang->monetary_unit}
			</td>
		</tr>
		</table>
		</div>
	</div>
    
	<!--@if($isShopConnected)-->
	<div class="lineClear"></div>

	<div class="box">판매관련정보</div>
	<div class="box">
		<div style="overflow:hidden;">
		<table cellspacing="0" width="100%" summary="" class="productVarsList" id="productVarsList">
			<col width="100" />
			<col />
				
			<tr>
				<th scope="row">{$lang->product_stand_price}</th>
				<td align="left">
					<input type="text" name="stand_price" id="stand_price" value="{$product->price_stand}" class="inputTypeText w200"/> {$lang->monetary_unit}
				</td>
			</tr>
			<tr>
				<th scope="row">{$lang->product_sale_price}</th>
				<td align="left">
					<input type="text" name="sale_price" id="sale_price" value="{$product->price_sale}" class="inputTypeText w200"/> {$lang->monetary_unit}
				</td>
			</tr>
			<tr>
				<th scope="row">{$lang->product_give_point}</th>
				<td align="left">
					<input type="text" name="give_point" id="give_point" value="{$product->buyed_point}" class="inputTypeText w200"/>
				</td>
			</tr>

		</table>
		</div>
	</div>
	<!--@end-->

	<div class="lineClear"></div>

	{@ $_tmp_idx = 1}
    <!--@if(!$document_srl)-->
    	{@$document_srl = "null"}
    <!--@end-->
	<div class="box">옵션설정</div>
    
	<div class="box">
		<table cellspacing="0" width="100%" summary="" id="productOptionList">
        <colgroup>
            <col width="20%">
            <col width="30%">
            <col width="30%">
            <col width="10%">
            <col width="10%">
        </colgroup>
        <thead>
        <tr>
        	<th>{$lang->product_option_name}</th>
        	<th>{$lang->product_option_item}</th>
        	<th>{$lang->product_option_price}</th>
        	<th>{$lang->product_option_req}</th>
        	<th><a href="#" onclick="addOption( 'option', null, 0, 0, 0 ); return false;" class="button green"><span>옵션추가</span></a></th>
        </tr>
        </thead>
        
        <tbody class="itemList">
        <!--옵션항목-->
		<tr>
			<td align="left"></td>
			<td align="left"></td>
			<td align="left"></td>
			<td align="left"></td>
			<td align="left"></td>
		</tr>
        <!--옵션항목-->
        </tbody>

		</table>
	</div>

<!--@if( $options )-->
<script type="text/javascript">
{@$_tmp_idx=1}
<!--@foreach($options as $key => $val)-->
<!--@if($val->option_parent_srl==0)-->
addOption( 'option', null, {$val->option_srl}, 0, 0, '{$val->option_name}', '{$val->option_req}' );
<!--@foreach($options as $key1 => $val1)-->
<!--@if($val->option_srl==$val1->option_parent_srl)-->
addOption( 'item', {$_tmp_idx}, {$val1->option_srl}, {$val1->option_price}, {$val->option_srl}, '{$val1->option_name}' );
<!--@end-->
<!--@end-->
{@$_tmp_idx++}
<!--@end-->
<!--@end-->
</script>
<!--@end-->    

	<div class="lineClear"></div>

    <!--@if(count($extra_keys))-->
	<div class="box">확장변수</div>
	<div class="box">
    <table cellspacing="0" summary="" class="extraVarsList">
    <col width="150" />
    <col />
    <!--@foreach($extra_keys as $key => $val)-->
    <tr>
        <th scope="row">{$val->name} <!--@if($val->is_required=='Y')-->*<!--@end--></th>
        <td>{$val->getFormHTML()}</td>
    </tr>
    <!--@endforeach-->
    </table>
	</div>
    <!--@endif-->

    <div class="editor">{$oDocument->getEditor()}</div>

	</div>
	<div class="tag">
		<input type="text" name="tags" value="{htmlspecialchars($oDocument->get('tags'))}" style="width:95%;" class="inputTypeText" title="Tag" />
		<p>{$lang->about_tag}</p>
	</div>
	<div>
        <div class="fl gap1">
            <!--@if($is_logged)-->
            <span class="button {$btn_class}"><input type="button" value="{$lang->cmd_temp_save}"  onclick="doDocumentSave(this); return false;" /></span>
            <span class="button {$btn_class}"><input type="button" value="{$lang->cmd_load}"  onclick="doDocumentLoad(this); return false;" /></span>
            <span class="button {$btn_class}"><input type="button" value="{$lang->cmd_back}" onclick="location.href='{getUrl('act','')}'" /></span>
            <!--@end-->
        </div>

        <div class="fr gap1">
            <span class="button {$btn_class}"><input type="button" value="{$lang->cmd_preview}" onclick="doDocumentPreview(this); return false;" /></span>
            <span class="button {$btn_class}"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
        </div>
	</div>
</form>

</div>

<!--#include("_footer.html")-->
<!--@end-->